-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: Speculative Availability #10563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: Speculative Availability #10563
Conversation
…s, add num_validators attribute
|
/cmd prdoc |
|
Command "prdoc" has failed ❌! See logs here |
|
/cmd label T0-node T8-polkadot |
|
Command "label T0-node T8-polkadot" has failed ❌! See logs here |
haikoschol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, just some comment/logging nits
| "Got {} backable candidates", backable.len() | ||
| ); | ||
|
|
||
| // now get the backed candidates corresponding to these candidate receipts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // now get the backed candidates corresponding to these candidate receipts | |
| // now get the backed candidates corresponding to these candidate hashes |
since the candidate receipt is part of the data we're retrieving
| gum::warn!( | ||
| target: LOG_TARGET, | ||
| error = ?err, | ||
| "Failed to spawn a fetch task" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "Failed to spawn a fetch task" | |
| session_index = ?leaf_session_index, | |
| "Failed to retrieve session info", |
| if let Some(session_info) = session_info { | ||
| let num_validators = | ||
| session_info.validator_groups.iter().fold(0usize, |mut acc, group| { | ||
| acc = acc.saturating_add(group.len()); | ||
| acc | ||
| }); | ||
|
|
||
| let (tx, rx) = oneshot::channel(); | ||
| sender | ||
| .send_message(AvailabilityStoreMessage::NoteBackableCandidates { | ||
| candidate_hashes, | ||
| num_validators, | ||
| tx, | ||
| }) | ||
| .await; | ||
| rx.await?.map_err(|_| Error::AvailabilityStore)?; | ||
| self.add_cores(ctx, runtime, leaf, leaf_session_index, scheduled_cores).await?; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if let Some(session_info) = session_info { | |
| let num_validators = | |
| session_info.validator_groups.iter().fold(0usize, |mut acc, group| { | |
| acc = acc.saturating_add(group.len()); | |
| acc | |
| }); | |
| let (tx, rx) = oneshot::channel(); | |
| sender | |
| .send_message(AvailabilityStoreMessage::NoteBackableCandidates { | |
| candidate_hashes, | |
| num_validators, | |
| tx, | |
| }) | |
| .await; | |
| rx.await?.map_err(|_| Error::AvailabilityStore)?; | |
| self.add_cores(ctx, runtime, leaf, leaf_session_index, scheduled_cores).await?; | |
| } | |
| let Some(session_info) = session_info else { continue }; | |
| let num_validators = | |
| session_info.validator_groups.iter().fold(0usize, |mut acc, group| { | |
| acc = acc.saturating_add(group.len()); | |
| acc | |
| }); | |
| let (tx, rx) = oneshot::channel(); | |
| sender | |
| .send_message(AvailabilityStoreMessage::NoteBackableCandidates { | |
| candidate_hashes, | |
| num_validators, | |
| tx, | |
| }) | |
| .await; | |
| rx.await?.map_err(|_| Error::AvailabilityStore)?; | |
| self.add_cores(ctx, runtime, leaf, leaf_session_index, scheduled_cores).await?; |
| tx: oneshot::Sender<Result<(), ()>>, | ||
| }, | ||
|
|
||
| /// Note that a candidate is backable. Only used by Speculative Availability to signal to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider updating the comments to use the plural since the message includes multiple candidate hashes.
| // given when speculative availability is requested on active leaves update, there may not be | ||
| // any backable candidates from Prospective Parachains at that the time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // given when speculative availability is requested on active leaves update, there may not be | |
| // any backable candidates from Prospective Parachains at that the time. | |
| // Given that speculative availability is requested on active leaves update, there may not be | |
| // any backable candidates from Prospective Parachains at that time. |
Description
Introduces Speculative Availability chunk requests within the Availability Distribution subsystem. In Availability Distibution subsystem we listen on
ActiveLeavesUpdateand call Prospective Parachains to gather backable candidates that we can start fetching their erasure encoded chunks from the backing group before the candidates are actually backed on chain. This feature is currently enabled by running the node with the--speculative-availabilityCLI flag.Review Notes
request_backale_candidatesout of Provisioner subsystem tosubystem-utilcrate to be used as well in Availability Distribution subsystem.CoreInfoandCoreInfoOriginprivate types inavailability-distribution::requestermodule.CoreInfois used to create fetch tasks now instead of using available cores directly. We constructCoreInfoinstances from calling Prospective Parachains for backable candidates and we denote the origin of theseCoreInfoinstances withCoreInfo::Scheduled.CoreInfoinstances created from candidates that have been backed on chain haveCoreInfo::Occupiedorigin.AvailabilityStoreMessage::NoteBackableCandidatesmessage type.polkadot_parachain_fetched_chunks_total[origin="scheduled"]metric.--speculative-availabilityCLI flag support.TODO
Checklist
Trequired)/cmd label <label-name>to add labels